import java.util.ArrayList;
import java.util.List;

/**
 * @author wz<br>
 * @version 1.0<br>
 * @ClassName Meal
 * @<Description> TODO
 * @date 2021/12/8 11:26<br>
 */
public class Meal {
  private List<Item> items=new ArrayList<Item>();

  public void addItem(Item item){
    items.add(item);
  }

  public float getCost(){
    float cost=0.0f;
    for (Item item:items){
      cost+=item.price();
    }
    return cost;
  }

  public void showItems(){
    for (Item item: items){
      System.out.println("Item : "+item.name());
      System.out.println(", Packing : "+item.packing().pack());
      System.out.println(", Price : "+item.price());
    }
  }

}
